package cn.gzsxt.music.util;

import org.springframework.stereotype.Component;

import cn.gzsxt.music.vo.MsgObj;

//自主编辑MsgObj
@Component
public class GetMsgUtil {
	
	public MsgObj getMsgObj(boolean condition, String success, String fail) {
		if (condition) {
			return new MsgObj(1,success);
		} else {
			return new MsgObj(0,fail);
		}		
	}
	
	public MsgObj getMsgObj(Object condition, Object successCondition, Object failCondition, String success, String failByCondition, String fail) {
		if (condition == successCondition) {
			return new MsgObj(1, success);
		} else if(condition == failCondition) {
			return new MsgObj(0, failByCondition);
		} else {
			return new MsgObj(0, fail);
		}		
	}
	
}
